package message

type TextBody struct {
	Content             string   `json:"content"`
	MentionedIdList     []string `json:"mentioned_list"`
	MentionedMobileList []string `json:"mentioned_mobile_list"`
}

type Text struct {
	Message
	TextBody *TextBody `json:"text"`
}

func NewText() *Text {
	t := &Text{}
	t.setType("text")
	return t
}

// 消息内容
func (t *Text) SetContent(content string) *Text {
	if t.TextBody == nil {
		t.setDefaultTextBody()
	}
	t.TextBody.Content = content

	return t
}
// 默认消息
func (t *Text) setDefaultTextBody() *Text {
	t.TextBody = &TextBody{}
	return t
}

// @id
func (t *Text) SetMentionedIds(ids []string) *Text {
	t.TextBody.MentionedIdList = ids

	return t
}

// @mobile
func (t *Text) SetMentionedMobiles(mobiles []string) *Text {
	t.TextBody.MentionedMobileList = mobiles
	return t
}
